package entity;

import java.util.Map;

import org.eclipse.core.runtime.IPath;

import tasks.ITask;

public class TaskInfo {
	
	private int _hashCode;
	
	private String _description = null;
	
	private boolean _isActive = false;
	
	private String _targetModule = null;
	
	private String _taskName= null;
	
	private Map<String,String> _parameters = null;
	
	private boolean _lastPerformed;
	
	private String _projectName;

	private IPath _path;
	
	public TaskInfo(ITask iTask) {
		setHashCode(iTask.hashCode());
		setDescription(iTask.toString());
		setActive(iTask.isActive());
		setTargetModule(iTask.getTargetModuleName());
		setParameters(iTask.getParameters());
		setTaskName(iTask.getTaskName());
		setPath(iTask.getPath());
		_lastPerformed=false;
	}
	
	private void setPath(IPath path) {
		_path=path;
	}

	public TaskInfo(int hashCode, String description, boolean isActive, String targetModule, Map<String,String> parameters) {
		setHashCode(hashCode);
		setDescription(description);
		setActive(isActive);
		setTargetModule(targetModule);
		setParameters(parameters);
		_lastPerformed=false;
	}

	public void setDescription(String description) {
		this._description = description;
	}

	public String getDescription() {
		return _description;
	}

	public void setActive(boolean isActive) {
		this._isActive = isActive;
	}

	public boolean isActive() {
		return _isActive;
	}

	public void setTargetModule(String targetModule) {
		this._targetModule = targetModule;
	}

	public String getTargetModule() {
		return _targetModule;
	}

	public void setParameters(Map<String,String> parameters) {
		this._parameters = parameters;
	}

	public Map<String,String> getParameters() {
		return _parameters;
	}

	public void setHashCode(int hashCode) {
		this._hashCode = hashCode;
	}

	public int getHashCode() {
		return _hashCode;
	}

	public void setTaskName(String taskName) {
		this._taskName = taskName;
	}

	public String getTaskName() {
		return _taskName;
	}

	public void setLastPerformed(boolean lastPerformed) {
		_lastPerformed = lastPerformed;
	}

	public boolean isLastPerformed() {
		return _lastPerformed;
	}

	public void setProjectName(String projectName) {
		_projectName = projectName;
	}

	public String getProjectName() {
		return _projectName;
	}

	public IPath getPath() {
		return _path;
	}
}
